package com.cn.zengzeng.spbzengzeng.controller;

import com.alibaba.fastjson.JSONObject;
import com.cn.zengzeng.spbzengzeng.test.HttpClientHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: zhangzengzeng
 * @Date: 2021/11/3 12:47
 */
@RestController
@RequestMapping("/getssr")
@Slf4j
public class GetSSRSource {
    @GetMapping(value = "/geterveryDay")
    public String geterveryDay() {
        JSONObject jsonObject = new JSONObject();
        Map<String, String> hashMap = new HashMap<>();
        String s = HttpClientHelper.doGet("https://www.tang-seo.com/4150.html",jsonObject,hashMap);
        int i = s.indexOf("<pre>");
        int i1 = s.indexOf("===来自lncn官网最后更新时间");
        return s.substring(i,i1);
    }
}
